/**
 * js中的5种继承方法
 * @constructor
 */
function Father(){}

// 原型链继承
function Son(){}
Son.prototype = new Father()

// 构造函数继承
function Son1(){
    Father.call(this,args)
}

// 组合继承
function Son2(){
    Father.call(this,args)
}
Son2.prototype = new Father()

// 原型继承
function Son3(){
    const obj = function (){}
    obj.prototype = new Father()
    return obj()
}


// 寄生式继承
function create(origin){
    const obj = function (){}
    obj.prototype = origin
    return obj
}

function Son4(origin) {
    const clone = create(origin)
    clone.getUserInfo=function (){
        console.log('获取用户信息！')
    }
    return clone;
}
// 寄生组合继承
// 省略、等会儿完善


// Es6 class extends关键字继承
class Son5 extends Father{
    constructor() {
        super();
    }
}
